package zut.cs.liziflower.mapper;

import org.apache.ibatis.annotations.Param;
import zut.cs.liziflower.entity.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author xuwenke
 * @since 2022-05-26
 */
public interface OrderMapper extends BaseMapper<Order> {

    //添加订单
    int addOrder(@Param("userid") Integer userid,
                 @Param("addressid") Integer addressid,
                 @Param("totalprice") BigDecimal totalprice,
                 @Param("message") String message,
                 @Param("status") Integer status);


    Order getOrder(@Param("userid") Integer userid,
                 @Param("addressid") Integer addressid,
                 @Param("totalprice") BigDecimal totalprice,
                 @Param("message") String message,
                 @Param("status") Integer status);

    List<Order> getAllPaidOrders(@Param("userid") Integer userid, @Param("status") Integer status);

    int updateStatus(@Param("orderid") Integer orderid, @Param("userid") Integer userid);

    int updatedFinished(@Param("orderid") Integer orderid, @Param("userid") Integer userid, @Param("status") Integer status);

    int deletePaid(@Param("orderid") Integer orderid, @Param("userid") Integer userid);
}
